Skip to content

apps: add git flags to create/update/deploy - #6371

Merged
pietern merged 4 commits into
mainfrom
add-apps-git-flags
Aug 25, 2026
Merged

apps: add git flags to create/update/deploy#6371
pietern merged 4 commits into
mainfrom
add-apps-git-flags

Conversation

@atreyadbrx

Copy link
Copy Markdown
Collaborator

Changes

Add ergonomic top-level flags for the GA git fields on the apps commands, which the code generator emits as // TODO: complex arg (so today they are only reachable via --json):

  • create / update: --git-url, --git-provider (App.GitRepository)
  • deploy: --git-branch, --git-tag, --git-commit, --git-source-code-path (AppDeployment.GitSource)

Why

The git repository and git deployment source are nested objects, so the generator skips flag generation for them. Users could only configure git-based app deployment by hand-writing JSON. These flags follow the command-overrides pattern (same approach as clusters/overrides.go).

The nested SDK pointers stay nil unless a git flag is set, so non-git requests are unchanged. Validation matches the API contract:

  • --git-url and --git-provider must be set together.
  • --git-branch / --git-tag / --git-commit are mutually exclusive (proto oneof).
  • --git-source-code-path requires a ref.
  • deployment_source is a oneof, so the workspace --source-code-path cannot be combined with the --git-* flags.

Tests

Unit tests in git_flags_test.go cover happy paths and each validation rule. Verified locally: go build, go test, and golangci-lint all pass.


Supersedes #6182 (which was opened from a fork and could not run CI). Incorporates review feedback from @atilafassina on that PR (the workspace-vs-Git mutual-exclusion check).

This pull request and its description were written by Isaac.

The apps create/update/deploy commands accept a git repository and git
deployment source, but the code generator emits these nested objects as
`// TODO: complex arg` so they were only reachable via --json. Add
ergonomic top-level flags for the GA git fields:

- create/update: --git-url, --git-provider (App.GitRepository)
- deploy: --git-branch, --git-tag, --git-commit, --git-source-code-path
  (AppDeployment.GitSource)

The nested SDK pointers stay nil unless a git flag is set, so non-git
requests are unchanged. Validation matches the API contract: url and
provider must be set together; branch/tag/commit are mutually exclusive;
source-code-path requires a ref.

Co-authored-by: Isaac
golangci-lint's perfsprint linter flags fmt.Errorf with a static string
and no format verbs. Both git flag validation errors are constant
strings, so switch them to errors.New.

Co-authored-by: Isaac
deployment_source is a proto oneof: an app deployment draws its code
from either a workspace path (--source-code-path) or a Git source, not
both. Reject the combination in the deploy git-source PreRunE so we don't
build a request the server and bundle validation treat as invalid.

Addresses review feedback from @atilafassina on #6182.

Co-authored-by: Isaac
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 92eb235

Run: 32772921110

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 1 4 274 1168 5:49
💚​ aws windows 1 4 276 1166 4:37
💚​ azure linux 1 4 273 1168 5:31
💚​ azure windows 1 4 275 1166 5:29
💚​ gcp linux 1 4 274 1168 6:42
💚​ gcp windows 1 4 276 1166 5:39
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:10 aws windows TestAccept
3:08 azure windows TestAccept
3:00 gcp windows TestAccept

The apps update usage now lists --git-url and --git-provider, so refresh
the cmd/workspace/apps acceptance output.txt to match.

Co-authored-by: Isaac
@pietern
pietern enabled auto-merge August 25, 2026 17:53
@pietern
pietern added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 9a93c4c Aug 25, 2026
25 checks passed
@pietern
pietern deleted the add-apps-git-flags branch August 25, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants